package com.mxx.common.data.utils;

import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Path;
import java.math.BigDecimal;
import java.util.function.Function;

/**
 * @Author itzgyw
 * @Date 2020-02-12
 * @Time 19:02
 * @Description:
 */
public class Paths {

    public static Expression toString(Path path) {
        return path.as(String.class);
    }

    public static Expression toInteger(Path path) {
        return path.as(Integer.class);
    }

    public static Expression toLong(Path path) {
        return path.as(Long.class);
    }

    public static Expression toShort(Path path) {
        return path.as(Short.class);
    }

    public static Expression toBigDecimal(Path path) {
        return path.as(BigDecimal.class);
    }
}
